
const options: {credentials:'include'} = {
    credentials: 'include'
};

export const checkeAIPayStatus = (time:number)=> {
    let formData = new FormData();
    formData.append("time", ''+time);
    return fetch('/pay/check-pay', {
        method: 'POST',
        body: formData,
        ...options
    }).then((r) => r.json());
}


export const getPayQrCode = ({ type }: {type:string}) => {
    let formData = new FormData();
    formData.append("type", type);
    formData.append("pay_origin", 'ai_points');
    formData.append("classify", '13');
    formData.append("update", ''+false);

    return fetch('/pay/get-qrcode', {
        method: 'POST',
        body: formData,
        ...options
    }).then((r) => r.json());
}

export const getAIPriceList = ()=> {
    return fetch('/aidraw/pay-ai-points', options);
}